/*************************testLine.cpp***********************
 * this file is the test file for Stations
 * author: Zebras Wen
 * date: 2012.11.03
 * version: 0.01
 * history:
 * copyLeft:
 *   all rights are under the GPL v3.0
 *********************************************************/

#include "Line.h"
#include "Station.h"
#include<iostream>
#include<algorithm>

using namespace std;


int main()
{
    Station station1, station2, station3, station4;
    station1.setStationName("Hefei");
    station2.setStationName("Shanghai");
    station3.setStationName("Guangzhou");
    station4.setStationName("Hangzhou");

    station1.addNextStation(&station2);
    station2.addNextStation(&station3);

    Line crh;
    crh.addStationEnd(&station1);
    crh.addStationEnd(&station2);
    crh.addStationEnd(&station3);

    cout<<"1st "<<crh<<endl;
    Station* delStat = crh.findStation("Shanghai");
    crh.delStations(delStat);
    crh.addStationEnd(&station2);

    cout<<"2nd "<<crh<<endl;

    crh.delStations("Shanghai");

    crh.addStationBefore(&station2, "Guangzhou");
    crh.addStationAfter(&station4, &station3);

    crh.setLineNo(10);
    cout<<"3rd "<<crh.getLineNo()<<"th line"<<endl;
    crh.printLine(cout);
}
